package com.news.service.impl;

import com.news.dao.CmsArticleDao;
import com.news.dao.impl.CmsArticleDaoImpl;
import com.news.entity.Article;
import com.news.service.CmsArticleService;

import java.util.List;
import java.util.Map;

/**
 * @Author:weiming
 * @Date:2021/4/1
 */
public class CmsArticleServiceImpl implements CmsArticleService {

    private CmsArticleDao cmsArticleDao = new CmsArticleDaoImpl();


    @Override
    public List getAllArticleInfo(int pageNum, int pageSize) {
        return cmsArticleDao.getAllArticleInfo(pageNum, pageSize);
    }

    @Override
    public List getAllArticleInfoByUser(int pageNum, int pageSize) {
        return cmsArticleDao.getAllArticleByUser(pageNum, pageSize);
    }

    @Override
    public int add(Article article) {
        return cmsArticleDao.add(article);
    }

    @Override
    public int update(Article article) {
        return cmsArticleDao.update(article);
    }

    @Override
    public int delete(Integer newsId) {
        return cmsArticleDao.delete(newsId);
    }

    @Override
    public Article getArticleById(int Id) {
        return cmsArticleDao.getArticleById(Id);
    }

    @Override
    public Map<String,Object> getArticleListByCatelogyId(int catelogyId) {
        return cmsArticleDao.getArticleListByCatelogyId(catelogyId);
    }

    @Override
    public List<Article> getArticleByUser(int pageNum, int pageSize) {
        return cmsArticleDao.getAllArticleByUser(pageNum, pageSize);
    }

    @Override
    public int changeCheck(Article article) {
        return cmsArticleDao.changeCheck(article);
    }
}
